package com.small.admin.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.small.admin.dto.OperateLogPage;
import com.small.common.msg.MsgPage;
import org.springframework.stereotype.Service;
import com.small.common.base.service.impl.BaseServiceImpl;
import com.small.admin.entity.OperateLog;
import com.small.admin.mapper.OperateLogMapper;
import com.small.admin.service.OperateLogService;

/**
 * 作者: fenny
 * 邮箱: 893146555@qq.com
 * 时间: 2017-10-17 15:28:29
 * 描述: 操作日志 实现
 */
@Service
public class OperateLogServiceImpl extends BaseServiceImpl<OperateLogMapper,OperateLog> implements OperateLogService {
    @Override
    public MsgPage<OperateLog> selectByPage(OperateLogPage logPage) {
        Page<Object> result = PageHelper.offsetPage(logPage.getOffset(), logPage.getLimit());
        MsgPage<OperateLog> page = new MsgPage<>(mapper.selectByPage(logPage));
        page.setTotal(result.getTotal());
        return page;
    }
}